package svc

import (
	"gitee.com/libwiki/go-zero-lib/app/user/internal/config"
	"gitee.com/libwiki/go-zero-lib/app/user/internal/middleware"
	"gitee.com/libwiki/go-zero-lib/package/libContext"
	"github.com/zeromicro/go-zero/rest"
)

type ServiceContext struct {
	*libContext.Context
	Config         config.Config
	TestMiddleware rest.Middleware
}

func NewServiceContext(c config.Config) *ServiceContext {
	ctx := &ServiceContext{
		Config:         c,
		TestMiddleware: middleware.NewTestMiddleware().Handle,
		Context:        &libContext.Context{},
	}
	ctx.InitContext(c.Config)
	return ctx
}
